
#include "threadpool.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

int main()
{
    int vi = 0;
    threadjob * job = NULL;
    if(Theadpool_create(5)!= 0)
    {
        printf("pool create error!\n");
    }
    for(vi = 0; vi < 150 ; ++vi)
    {
        job = (threadjob *)malloc(sizeof(threadjob));
        job->num = vi;
        Threadpool_add_job((void *)job);
        //sleep(1);
    }
    Threadpool_destroy();
    //sleep(5);
    PrintJobs();
    printf("all work have finished\n");
    return 0;
}
